﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace LoginTest
{
    public partial class BaseManage : Form
    {
        public BaseManage()
        {
            InitializeComponent();
        }

        private void BaseManage_Load(object sender, EventArgs e)
        {
            this.Text = "基本信息";
        }

        private void btn_close_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btn_ok_Click(object sender, EventArgs e)
        {
            using (SqlConnection connection = new SqlConnection(@"Data Source=127.0.0.1;Initial Catalog =GXFactoryDB ;Integrated Security = True"))
            {
                string sql = "select UserName,UserRole,UserPwd,FactoryDepartment from User_tb ";
                DataSet ds = new DataSet();
                SqlDataAdapter adapter = new SqlDataAdapter(sql, connection);
                adapter.Fill(ds, "User_tb");
                dataGridView1.DataSource = ds.Tables["User_tb"];

                connection.Close();
            }
        }
    }
}
